<?php

namespace app\home\controller;

use app\home\controller\Common;
use think\Db;
use think\facade\Env;

class Run extends Common
{
    public function getData()
    {
        $data = input('post.');

        $where = 'Age = '.$data['age'];
        $where .= ' AND sex = '.$data['sex'];
        $where .= ' AND Km = "'.$data['km'].'"';

        $res = Db::name('run_level')->where($where)->select();

        if ($res) {
            $json['status'] = 1;
            $json['message'] = lang('success');
            $json['data'] = $res;
            /*********************记录日志***********************/
            echo json_encode($json);
            exit;
        } else {
            $json['status'] = 0;
            $json['message'] = lang('fail');
            echo json_encode($json);
            exit;
        }

    }



}
